<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<% 
 /**
  功能名称：学生班级信息导入
  创建时间:2013-5-21
  创建人：马明
**/
%>
<%
String path = request.getContextPath();
String type = request.getParameter("type");
String from = request.getParameter("from");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>批量导入</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="<%=path%>/css/index_css.css" rel="stylesheet" type="text/css" />
	<script src="<%=path%>/js/resizeIframe.js" type="text/javascript"></script>
	<script type="text/javascript">
		window.onload = function(){
      	
      	resizeIframe();
        
          
        
        
      }
      
      function doSubmit(){
      	if(document.getElementById('file').value.length==0){
      		alert('请您选择要上传的excel文件');
      		return;
      	}
      	document.myform.submit();
      	document.getElementById('buttonDiv').innerHTML="<img src=\"<%=path %>/images/jindu.gif\" width=\"30\" height=\"30\" align=\"absmiddle\" />正在导入...";
      }
      
      function changeType(chooseValue){
      	document.getElementById('chType').value=chooseValue;
      }
      //返回
      function goback() {
      	 window.location.href='${requestScope.BACKURL }'; 
      }
	</script>
	<style type="text/css">
		.excel{ background-color:#999; font-size:13px;}
		.excel td{ background-color:#fff; white-space:nowrap;}
		.excel th{ background-color:#E7E7E7; font-weight:normal;}
	</style>
  </head>
  
  <body>
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="25" align="right" valign="bottom" bgcolor="#ECE9D8"><img src="<%=path %>/images/bk_13.gif" width="18" height="18" align="absmiddle" /><a href="javascript:goback();">返回</a>&nbsp;&nbsp;&nbsp;
    	<img src="<%=path %>/images/nv_hidden.gif" width="14" height="14" border="0" /> <a href="<%=path %>/doExportStudentTemplateGradeAndClassAction.action?chooseType=<%=type %>&orgId=${param.orgId }">下载导入班级信息模板</a>&nbsp;&nbsp;</td>
  </tr>
  <tr>
    <td align="center" valign="top" bgcolor="#ECE9D8"><table width="95%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="1" bgcolor="#ABA899"></td>
      </tr>
      <tr>
        <td height="1" bgcolor="#FFFFFF"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="25" align="center" valign="middle" bgcolor="#ECE9D8">
    <form name="myform" action="<%=path %>/addStudentClassGradeAndClassAction.action" enctype="multipart/form-data" method="post">
	<input type="hidden" name="backURL"  value="${requestScope.BACKURL }">
    <input id="chooseType" type="hidden" name="chooseType" value="<%=type%>">
    
    <table width="95%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="35" align="center" valign="bottom"><input id="file" name="file" type="file" size="45" /></td>
      </tr>
      <tr>
        <td height="35" align="center"><div id="buttonDiv"><input type="button" onclick="doSubmit();" name="Submit" value="提 交" /></div>&nbsp;&nbsp;&nbsp;</td>
      </tr>
    </table>
    </form>
    </td>
  </tr>
  <tr>
    <td height="25" align="left" valign="top" bgcolor="#ECE9D8" class="border_2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="top" class="tb_10 border_2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="25" align="left" class="f_4">一、常用模板格式</td>
          </tr>
          <tr>
				<td height="120" align="left" valign="top">
				<div style="overflow: auto; width: 610px; height: 100%;">
					<table class="excel" cellspacing="1" cellpadding="3" width="602" height="103">
						<tr>
							<th scope="col"></th>
							<th scope="col">A</th><th scope="col">B</th><th scope="col">C</th><th scope="col">D</th>
						</tr>
						<tr>
							<th scope="row">1</th>
							<td>学籍编号</td><td>姓名</td><td>年级名称</td><td>班级名称</td>
						</tr>
						<tr>
							<th scope="row">2</th>
							<td>A001001</td><td>张三</td><td></td><td></td>
						</tr>
						<tr>
							<th scope="row">3</th>
							<td>A001002</td><td>李四</td><td></td><td></td>
						</tr>						
					</table>
				</div>
				</td>
			</tr>
          <tr>
            <td height="25" align="left" valign="middle"><span class="f_4">二、高级导入格式</span></td>
          </tr>
          <tr>
          	
            <td height="25" align="left" valign="top" style="line-height:20px">注：上传必须为Excel表单格式，后缀为.xls，并且所上传文件的表格列名如下： <br /> 
            	学籍编号，姓名，年级名称，班级名称,<font color= "red">其中学籍编号不能为空</font><br>
        	其他列可为空或不导入。时间必须遵守“2007-01-28”格式。 </td>       
          </tr>
          <tr>
            <td height="25"><span class="f_4">以上列出的导入值必须遵守下面的格式：</span></td>
          </tr>
          <tr>
            <td height="25" align="left" valign="top">
            <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DCDCDC">
              <tr>
	              <td width="14%" height="25" align="right" bgcolor="#FFFFFF" class="f_4">年级名称&nbsp;</td>
	              <td width="86%" bgcolor="#FFFFFF" >                
					<c:if test="${not empty requestScope.GRADELIST}">
	                		<c:forEach items="${requestScope.GRADELIST}" var="grade">
	                			${grade.name}    
	                		</c:forEach>
	                </c:if>	              </td>
              </tr>
              <tr>
                <td height="25" align="right" bgcolor="#FFFFFF" class="f_4">班级名称&nbsp;</td>
           		<td width="86%" bgcolor="#FFFFFF" >
	                <c:if test="${not empty requestScope.CLASSLIST}">
	                		<c:forEach items="${requestScope.CLASSLIST}" var="class">
	                			${class.name}    
	                		</c:forEach>
	                </c:if>
	            </td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="25" class="f_2">说明1:每列只能选择所有值中的一个值进行导入，根据需要将上面列出的信息拷贝到对应的Excel表格的单元格里
           </td>
          </tr>   
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="25" align="center" valign="middle" bgcolor="#ECE9D8"></td>
  </tr>
</table>
</body>
</html>
